import 'package:flutter/material.dart';

class MyApp9 extends StatelessWidget {
  const MyApp9({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          '布局组件使用',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Colors.purple,
        centerTitle: true,
      ),
      body: Center(
        child: Container(
          height: 100,
          padding: const EdgeInsets.only(left: 15, right: 15),
          color: Colors.cyan,
          child: Row(
            // 1. 设置主轴对齐方式
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Expanded(
                flex: 2,
                child:  Image.network(
                  'https://yanxuan-item.nosdn.127.net/afd6199278a5b8fd783bc4947960fabc.jpg',
                  width: 86,
                )
              ),
              const Expanded(
                flex: 5,
                child: Text('茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯')
              ),
              const Expanded(
                flex:1,
                child: Icon(Icons.add_a_photo_outlined)
              )
            ],
          ),
        ),
      )
    );
  }
}
